package com.cobra.rdd.operator.transform

import org.apache.spark.{SparkConf, SparkContext}
//分区不变原理
object Spark09_RDD_Operator_Transform_Par {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("Spark09_RDD_Operator_Transform_Par")
    val sc = new SparkContext(sparkConf)
    //算子获取
    val rdd = sc.makeRDD(List(1,2,3,4),2)
    val mapRDD = rdd.map(_ * 2)
    mapRDD.saveAsTextFile("output")
    sc.stop()
  }
}
